import {defineStore} from "pinia";
import axios from "axios";


export const useStore = defineStore('general', {
    state: () => {
        return {
            user: {
                username: '',
                email: '',
                role: '',
                registerTime: null

            }
        }
    }, getters: {
        avatarUrl() {
            if (this.user.avatar)
                return `${axios.defaults.baseURL}/images${this.user.avatar}`
            else return 'https://lf-flow-web-cdn.doubao.com/obj/flow-doubao/samantha/logo-icon-white-bg.png'
        }
    }
})